package sv.gob.mh.dgii.model;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
/**
 * 
 * @author luis.monterrosa
 *
 */
@Embeddable
public class VwEdConsultaInformeId implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -7137699962857333633L;
	public VwEdConsultaInformeId() {
		
	}
	
	public VwEdConsultaInformeId(Long cdeclaracion) {
		this.cdeclaracion = cdeclaracion;
	}
	
	private Long cdeclaracion;
	@Column (name = "C_DECLARACION", nullable = false )
	public Long getCdeclaracion() {
		return cdeclaracion;
	}
	public void setCdeclaracion(Long cdeclaracion) {
		this.cdeclaracion = cdeclaracion;
	}
	@Column (name="C_CAMPO", nullable = false)
	public String getCcampo() {
		return ccampo;
	}
	public void setCcampo(String ccampo) {
		this.ccampo = ccampo;
	}
	private String ccampo;
	
	private Integer nrenglon;
	@Column (name="N_RENGLON", nullable = false)
	public Integer getNrenglon() {
		return nrenglon;
	}

	public void setNrenglon(Integer nrenglon) {
		this.nrenglon = nrenglon;
	}

	@Override  
	public boolean equals(Object obj) {  
		if (this == obj) {  
			return true;
		}
		if (!(obj instanceof VwEdConsultaInformeId)) {
			return false;
		}
		final VwEdConsultaInformeId castOther = (VwEdConsultaInformeId) obj;
		return new EqualsBuilder().append(cdeclaracion, castOther.getCdeclaracion())
			.append(ccampo,	castOther.getCcampo())
			.append(nrenglon, castOther.getNrenglon())
			.isEquals();
	}
	
	public int hashCode() {
		return new HashCodeBuilder().append(cdeclaracion).append(ccampo).append(nrenglon).hashCode();
	}
	
}
